package cn.tx.构造方法;

/**
 * @Package: cn.tx.构造方法
 * @Description: 类作用描述
 * @Author Mxb
 * @CreateDate 2020/10/17 8:41
 * @Version 1.0
 */
class Student2 {
    //成员变量
    private String name;
    private int age;

    //构造方法
    public Student2() {
    }

    public Student2(String name, int age) {
        this.name = name;
        this.age = age;
    }

    //成员方法
    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getAge() {
        return age;
    }

    public void show() {
        System.out.println(name + "," + age);
    }
}
